import Vue from 'vue'

import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';

import 'element-ui/lib/theme-chalk/index.css';
import './styles/global.scss'
import './styles/normal.scss'
import './styles/night.scss'

import VueHighlightJS from 'vue-highlightjs'
import 'highlight.js/styles/default.css' // or other highlight.js theme

// 组件注册
import DemoBlock from "@/components/DemoBlock.vue"
// ***********************************************************
import RtlinkUIPlus from "rtlink-ui-plus"
import RtlinkIcons from "rtlink-icon"

// ============= 测试时的组件注册 =============
import icons from "@/UIcomponents/icons"
import RtFormulaEditor from "@/UIcomponents/formula-editor/main.vue"
import RtFormulaEditorHeavy from "@/UIcomponents/formula-editor-heavy/main.vue"

import config from "@/config.js"

// 本地文件
if (config.usingLocalFiles) {
  Vue.use(icons)
  Vue.component("rt-formula-editor", RtFormulaEditor)
  Vue.component("rt-formula-editor-heavy", RtFormulaEditorHeavy)
}
// 已发布的文件
else {
  Vue.use(RtlinkUIPlus)
  Vue.use(RtlinkIcons)
}
// ============= ============= =============

Vue.use(router)
Vue.use(ElementUI, { size: 'small' })
Vue.use(VueHighlightJS)

Vue.component("demo-block", DemoBlock)

new Vue({
  store,
  router,
  render: (h) => h(App)
}).$mount('#app')